import { createRouter, createWebHistory } from 'vue-router'
import StartPage from "@/views/enter/StartPage.vue";
import MainPage from "@/views/main/MainPage.vue";
import HelpPage from "@/views/enter/HelpPage.vue";
import LoginPage from "@/views/login/LoginPage.vue";
import SearchPage from "@/views/search/SearchPage.vue";
import MainView from "@/views/main/MainView.vue"
import OrderManage from "@/views/main/OrderManage.vue";
import ProductManage from "@/views/main/ProductManage.vue";
import AccountManage from "@/views/main/AccountManage.vue";

const routes = [
  {
    path: '/',
    component: StartPage
  },
  {
    path: '/help',
    component: HelpPage
  },
  {
    path: '/mainPage',
    component: MainPage,
    children: [
      { path: '/mainView', component: MainView },
      { path: '/orderManage', component: OrderManage },
      { path: '/productManage', component: ProductManage },
      { path: '/accountManage', component: AccountManage },

    ]
  },
  {
    path: '/login',
    component: LoginPage
  },
  {
    path: '/search',
    component: SearchPage
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
